Skip to content

README: sections for the most-used APIs it did not cover, OCR first - #94

Merged
tomasr78 merged 1 commit into
mainfrom
readme-most-used-apis
Nov 11, 2026
Merged

tomasr78 merged 1 commit into
mainfrom
readme-most-used-apis

Conversation

@tomasr78

Copy link
Copy Markdown
Contributor

What this adds

Complete programs for the most-used ConvertAPI conversions that the README did not cover yet. Each one reads CONVERTAPI_TOKEN, saves to output like the existing snippets, and has a row in the Tasks table:

  • OCR a scanned PDF in C# (pdf/to/ocr): a new task section right after "Extract text from PDF in C#".
  • New sections under "More conversions and PDF tools":
    • Combine images into one PDF (images/to/pdf with Files)
    • Text to PDF (txt/to/pdf)
    • HEIC to JPG (heic/to/jpg)
    • Web page screenshot (html/to/png with Url)
    • Markdown conversion: PDF, Word, PowerPoint, Excel or HTML to Markdown for LLM and search pipelines, and Markdown to PDF (pdf/to/md, md/to/pdf)
    • Make a PDF accessible (pdf/to/pdfua)
    • Read PDF metadata (pdf/to/meta)
    • Extract data with AI (pdf/to/extract with DocumentType)
    • Read email metadata (email/to/metadata)
    • Update a Word table of contents (docx/to/docx with UpdateTableOfContents and UpdateReferences)
  • One sentence each, no new section:
    • Image to PDF: PNG, TIFF, GIF, HEIC and WEBP work the same way with their own format code; "tiff" also takes TIF files.
    • Word to PDF: "txt" or "html" in place of "pdf".
    • Excel to PDF: "csv" in place of "pdf", one CSV per worksheet.
    • Under "More conversions and PDF tools": every other format pair is the same call, with a link to https://www.convertapi.com/api.
  • An "Also available" list, links only: ZUGFeRD, Factur-X and Peppol e-invoices, QR codes and barcodes, PDF crop and PDF/A validation.

Only README.md changes. Example projects for the README's "... in C#" tasks and for OCR follow in a second pull request after this one merges.

How each snippet was checked

  • Every parameter against the OpenAPI spec (https://v2.convertapi.com/info/openapi/{from}/to/{to}) and the converter's docs page on www.convertapi.com. Every docs page the README links answers 200.
  • Every new block ran verbatim, as Program.cs of a new console project with ConvertApi 3.2.2 from nuget.org, against the staging API on 2026-11-11, with made-up sample files. The uploaded and result files were deleted after each run.
Block Output
OCR a scanned PDF in C# (a 1-page scanned letter) output/scanned.pdf, 149,869 bytes, with a text layer
Combine images into one PDF (2 portrait JPGs) output/page1.pdf, 206,902 bytes, 2 A4 pages
Text to PDF output/notes.pdf, 37,496 bytes
HEIC to JPG output/photo.jpg, 17,117 bytes, 1200 x 800
Web page screenshot output/cdn_convertapi_com.png, 1,220,402 bytes, the whole page
PDF to Markdown (Images=remove) output/document.md, 3,017 bytes
Markdown to PDF output/document.pdf, 64,798 bytes
Make a PDF accessible output/document.pdf, 803,710 bytes, tagged, pdfuaid:part 1
Read PDF metadata output/document.json, 241 bytes
Extract data with AI (a sample invoice) output/invoice.json, 1,495 bytes
Read email metadata (an EML with 3 attachments) output/email.json, 1,159 bytes
Update a Word table of contents output/report.docx, 13,609 bytes, TOC and cross-reference updated
  • The format swaps that the one-line sentences promise ran the same way: PNG, TIFF, a .tif file, GIF, HEIC and WEBP to PDF; DOCX to TXT and HTML; XLSX to CSV; HEIC to PNG; a web page to JPG; DOCX, PPTX, XLSX and HTML to Markdown; and PDF/UA from an untagged PDF. 16 of 16 passed.
  • python3 .github/ci/check_csharp.py readme-build: 56 of 56 blocks build. In the Examples workflow, "OCR a scanned PDF in C#" runs like the other "... in C#" blocks, with test.pdf copied in as scanned.pdf: one more conversion per job. The new #### blocks are built only.

Choices worth a look

  • OCR: the text names de and es as language examples, because the spec currently lists French as fa and the API rejects fr.
  • OCR: on a clean scan with a bordered table, the default OcrQuality (fast) left out the table's text and enhanced read all of it. The section keeps the default and says when to add enhanced.
  • images/to/pdf gives every page the same size and orientation, so a portrait scan next to a landscape photo is letterboxed. The section says so and names PageOrientation.
  • pdf/to/md embeds images as base64 by default (345 KB for the 6-page Examples/TestFiles/test.pdf). The snippet uses Images=remove (3 KB), which the spec describes as the compact output for machine processing, and the text names the default and describe.
  • The screenshot converts https://cdn.convertapi.com/public/files/demo, the page the SDK examples use for URL conversions.

Not changed: the library, the examples, build.yml, CHANGELOG.md and RELEASING.md.

🤖 Generated with Claude Code

Adds complete programs, each with a row in the Tasks table, for OCR (a new
"OCR a scanned PDF in C#" section next to text extraction), email metadata,
updating a Word table of contents, PDF/UA, PDF metadata, text to PDF,
combining images into one PDF, HEIC to JPG, web page screenshots, Markdown
in both directions and AI data extraction. One sentence each points to other
image formats, Word to TXT or HTML, Excel to CSV and the API reference, and
an "Also available" list links e-invoices, QR codes and barcodes, PDF crop
and PDF/A validation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 10:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are identified for this README-only update expanding conversion examples and guidance.

No open issues 🎉

What changed in this PR

Expands the .NET SDK README with examples for previously uncovered ConvertAPI tasks, prioritizing OCR for scanned PDFs. No library or example-project code changes.

Changes:

  • Adds complete C# snippets for OCR, image and Markdown conversions, PDF accessibility, metadata extraction, AI data extraction, and Word table-of-contents updates.
  • Adds Tasks table links and guidance on format alternatives and conversion options.
  • Links to additional converters for e-invoices, QR codes, barcodes, PDF cropping, and PDF/A validation.
File Description
README.md Adds conversion examples, navigation links, parameter guidance, and links to further API documentation.

Review effort: Balanced

@tomasr78
tomasr78 merged commit b21a893 into main Nov 11, 2026
4 checks passed
@tomasr78
tomasr78 deleted the readme-most-used-apis branch November 11, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants